<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<? include '../console/interview_console.php'; ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="../css/iframe01.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body{
	padding-top:30px;
	padding-left:20px;
	font:15px '微软雅黑';
	color:#666;
}

.button_1{
	border:0;
	background:url(../image/button_1.jpg) no-repeat;
	background-size:100% 100%;
	width:120px; height:30px;
	color:#FFF;
	font:15px '微软雅黑';
	letter-spacing:2px;
}
.button_1:hover{
	background:url(../image/button_1_hover.jpg) no-repeat;
	background-size:100% 100%;
}
.button_2{
	border:0;
	background:url(../image/button_2.jpg) no-repeat;
	background-size:100% 100%;
	width:60px; height:25px;
	color:#FFF;
	font:15px '微软雅黑';
	letter-spacing:2px;
}
table td{ border:0;}


.file-box{ position:relative;width:340px} 
.txt{ } 
.btn{ background-color:#FFF; border:1px solid #CDCDCD; width:65px; height:25px; font:13px '微软雅黑';} 
.file{ position:absolute; top:0; right:40px; height:24px; filter:alpha(opacity:0);opacity: 0;width:260px } 

</style>
</head>

<?php
if(isset($_POST['submit'])){
	$name=$_POST['name'];
	$job=$_POST['job'];
	$date=$_POST['date'];
	$interviewer=$_POST['interviewer'];
	$other=$_POST['other'];
	
	if($name==NULL||$_FILES['resume']['name']==NULL||$job==NULL||$date==NULL||$interviewer==NULL){
		alert("信息不全");
		open("./interview_iframe_add.php","_self");
	}else{
	
	if(isset($_FILES['resume'])){
		$resume=$_FILES['resume'];
		$now=date("Ymdhis");
	    $file_name=$now.$resume['name'];
        move_uploaded_file("$resume[tmp_name]","../resume/".iconv("UTF-8","gb2312",$file_name));
		
		$file_name="../resume/$file_name";
	}else{
		$file_name="";
	}
	
	$interview=new interview();
	$status=$interview->addItem($date,$name,$job,$interviewer,$file_name,'待面试',$other);
	
	if($status==1){
		alert("添加成功!");
	}else{
		alert("添加失败!");
	}
	}
}
?>

<body>
<table width="80%" align="left" border="0" cellpadding="0" cellspacing="0" height="300">
<form action="./interview_iframe_add.php" method="post" enctype="multipart/form-data">
<tr><td width="100"><label>姓名:</label></td><td><input type="text" name="name" /></td></tr>
<tr><td><label>面试职位:</label></td><td><input type="text" name="job" /></td></tr>
<tr><td><label>面试时间:</label></td><td><input type="text" name="date" /> (如:2015-03-15 10:00)</td></tr>
<tr><td><label>面试官:</label></td><td><input type="text" name="interviewer" /></td></tr>
<!--<tr><td><label>简历:</label></td><td><input type="file" name="resume" /></td></tr>-->
<tr><td><label>简历:</label></td><td>
<div class="file-box"> 
<input type='text' name='textfield1' id='textfield1' class='txt' /> 
<input type='button' class='button_2' value='浏览...' /> 
<input type="file" name="resume" class="file" id="fileField" size="28" onchange="document.getElementById('textfield1').value=this.value" />
</div>
</td></tr>
<tr><td><label>备注:</label></td><td><input type="text" name="other" /></td></tr>
<tr><td colspan="2"><input type="submit" value="提交" name="submit" class="button01" /></td></tr>
</form>
</table>
</body>
</html>